package com.vogue.supplymall.admin.business.domain.dao.impl;

import com.vogue.supplymall.admin.business.domain.dao.AdminOrganDao;
import com.vogue.supplymall.admin.business.domain.mapper.AdminOrganMapper;
import com.vogue.supplymall.admin.business.domain.model.AdminOrgan;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * The type Admin organ dao.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-04-26
 */
@Repository("adminOrganDao")
public class AdminOrganDaoImpl extends BaseDaoImpl<AdminOrgan, Long> implements AdminOrganDao {
    @Resource
    private AdminOrganMapper adminOrganMapper;

    @Override
    public String getPlatFormByST() {
        String sql = "select DISTINCT ap.platform"
                + " from admin_organ ao"
                + " join admin_platform ap on ao.id=ap.organid and disabledflag = 0"
                //+ " where ao.syscode=#{syscode} and ao.tel=#{tel}"// base_registinfo这个表里已经有手机号，并且在之前已经做验证
                + " where ao.syscode=#{syscode} "
                + " order by isbind desc";

        return sql;
    }

    @Override
    public String getAdminDict() {
        String sql = "select name,platform code,codevalue"
                + " from admin_private_platform ";

        return sql;
    }


}
